import React, {FC, useEffect, useState} from "react";
import {Space, Typography} from "antd";
import {FormOutlined} from "@ant-design/icons";
import styles from "./Logo.module.scss"
import {Link} from "react-router-dom";
import useGetUserInfo from "../hooks/useGetUserInfo";
import {HOME_PATH, MANAGE_INDEX_PATH} from "../router";


const {Title} = Typography


const Logo: FC = () => {

    const {username, nickname} = useGetUserInfo()
    const [pathname, setPathname] = useState(HOME_PATH)

    useEffect(() => {
        if (username) {
            setPathname(MANAGE_INDEX_PATH)
        }
    }, [username])

    return (
        <div className={styles.container}>

            <Link to='/'>
                <Space>
                    <Title>
                        <FormOutlined></FormOutlined>
                    </Title>
                    <Title>
                        小木问卷
                    </Title>
                </Space>
            </Link>
        </div>
    );
};
export default Logo;